<%@ Page Language="C#" MasterPageFile="~/MasterPages/manager/manager.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="manager_pages_Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<h2>Web Pages</h2>
<script type="text/javascript">
    function showNewPageForm()
    {
        document.getElementById('np').style.display = "inline";
    }
    
    function hideNewPageForm()
    {
        document.getElementById('np').style.display = "none";
    }
</script>
<div>
  <b class="rc">
  <b class="rc1"><b></b></b>
  <b class="rc2"><b></b></b>
  <b class="rc3"></b>
  <b class="rc4"></b>
  <b class="rc5"></b></b>

  <div class="rcfg">
    <!-- content goes here -->
    <asp:LinkButton ID="btnViewGrid" runat="server" OnClick="btnViewGrid_Click">Grid</asp:LinkButton>
    |
    <asp:LinkButton ID="btnList" runat="server" OnClick="btnList_Click">List</asp:LinkButton>&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:DropDownList runat="server" ID="ddlAction" AutoPostBack="True" OnSelectedIndexChanged="ddlAction_SelectedIndexChanged" AppendDataBoundItems="true">
        <asp:ListItem Text="Select an action..." />
        <asp:ListItem Text="Delete selected" Value="delete" />
        <asp:ListItem Text="Set as home page" Value="sethomepage" />
        <asp:ListItem Text="Set Members Only" Value="secure" />
        <asp:ListItem Text="Set Public" Value="public" />
        <asp:ListItem Text="Set Template:" Value="" />
    </asp:DropDownList>&nbsp;&nbsp;&nbsp;&nbsp;
    <A onclick="showNewPageForm();" href="javascript:void(0);">+ New Page</A> <DIV style="DISPLAY: none" id="np"><asp:TextBox id="txtPageTitle" runat="server"></asp:TextBox> 
    <asp:Button id="btnCreateNewPage" runat="server" Text="Save and Edit" Font-Bold="true" OnClick="btnCreateNewPage_Click"></asp:Button> </DIV>
  </div>

  <b class="rc">
  <b class="rc5"></b>
  <b class="rc4"></b>
  <b class="rc3"></b>
  <b class="rc2"><b></b></b>
  <b class="rc1"><b></b></b></b>
</div>
<asp:DataList id="dlWebPages" runat="server" DataSourceID="odsWebPages" OnItemDataBound="dlWebPages_ItemDataBound" RepeatLayout="Flow" RepeatDirection="Horizontal" DataKeyField="ID"><ItemTemplate>
                <span class="webpage_grid_row" runat="server" id="rowcontainer">
                    <div class="webpage_grid_rowheader" runat="server" id="rowheader">
                        <asp:Literal runat="server" ID="litPageID" Visible="false" Text='<%#Eval("ID") %>' />
                        <asp:CheckBox runat="server" ID="chkWebPage" style="float:left;" />
                    </div>
                    <span class="webpage_grid_pagedetails" runat="server" id="rowdetails">
                        <a href='<%#"Build.aspx?id=" + Eval("ID") %>'><asp:Image runat="server" ID="imgPage" ImageUrl="~/manager/images/WebPage.gif" style="float:left;margin-right:10px;" /></a>
                        <asp:HyperLink runat="server" ID="linkPage" CssClass="linkPage" NavigateUrl='<%#"Build.aspx?id=" + Eval("ID") %>' Text='<%#Eval("Title") %>' style="float:left;" />
                        <asp:Literal runat="server" ID="litPageSecurity" Text='<%#(bool)Eval("IsSecure") ? "(Secure)" : "" %>' />
                        <asp:HyperLink runat="server" ID="linkPreview" CssClass="linkPreview" Text="Preview" style="float:left;font-size:small;color:#777" target="_blank"/>
                    </span>
                    <span class="webpage_grid_pageurl" runat="server" id="rowaddress">
                        <asp:HyperLink runat="server" ID="linkAddress" Text="page url" />
                    </span>
                </span>
            
</ItemTemplate>
</asp:DataList> <asp:ObjectDataSource id="odsWebPages" runat="server" TypeName="TanashCMS.Business.WebPage" SelectMethod="List" OldValuesParameterFormatString="original_{0}"><SelectParameters>
<asp:ProfileParameter PropertyName="WebsiteID" Type="Int32" Name="WebsiteID"></asp:ProfileParameter>
<asp:Parameter Type="Int32" DefaultValue="0" Name="ParentPageID"></asp:Parameter>
</SelectParameters>
</asp:ObjectDataSource> 
</asp:Content>

